const obj ={
    name:'nyf',
    food:'sweet',
    sex:'man'
}
// const food = obj.food;
// es6 提供了优雅的api es6的解构
let {name, food} = obj;
console.log(name,food);
// let name = '123';
// var a = 1;
// var a = 2;

function introduce({name,age}){
    console.log
    (`${name},旅梦的好朋友,大佬最喜欢的食物是${food}`);
}
introduce(obj.name,obj.food);

